(function ($) {
    $(function () {
        $('button.trigger_task').on('click', function (e) {
            e.preventDefault();
            e.stopPropagation();
            var button = this;
            button.disabled = true;
            $.get($(this).data('href')).done(function (data) {
                alert('成功')
            }).fail(function (jqXHR, textStatus, errorThrown) {
                alert('异常' + errorThrown);
            }).always(function () {
                button.disabled = false;
            });
        });
    });
})(jQuery || django.jQuery);